﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PerfumeShopManagement.Utility;
using PerfumeShopManagement.Controller;
using PerfumeShopManagement.Model;

namespace PerfumeShopManagement.View
{
    public partial class frmExportCheckDetail : Form, IDetailView
    {
        public frmExportCheckDetail()
        {
            InitializeComponent();
        }

        private void doAutoDateTime()
        {
        }

        public void ResetFieldWithoutId()
        {
            // Reset without id
            lblTotal.Text = "0.0";
            cbbCustomer.Text = "";
            reloadGridView();
        }

        public void SetNextId()
        {
            lblExportCheckId.Text = Constants.AUTO_NUMBERING_MESSAGE;
        }

        private void reloadGridView()
        {
            // Load grid view
            //object[] buffer = new object[5];
            //List<DataGridViewRow> rows = new List<DataGridViewRow>();
            //List<object> products = ControllerFactory.ExportCheckController.GetAllObjects();
            //foreach (Product item in products)
            //{
            //    buffer[0] = item.pro;
            //    buffer[1] = item.CustomerName;
            //    buffer[2] = item.PhoneNumber;
            //    buffer[3] = item.Address;
            //    buffer[4] = item.Username;

            //    rows.Add(new DataGridViewRow());
            //    rows[rows.Count - 1].CreateCells(gridCustomers, buffer);
            //}
            //gridCustomers.Rows.Clear();
            //gridCustomers.Rows.AddRange(rows.ToArray());
        }
    }
}
